<h2>Manage Schedules</h2>

<table id="sub" class="tablesorter"><thead class = "forms">
<tr><th>Name of Teacher</th><th>Subject Name</th><th>Description</th><th>Date</th><th>Time</th><th>Admin Status</th></tr></thead><tbody>

<h3>Scheduled subjects</h3>
<?php $i = 1;?>
<?php foreach($viewAll->result() as $test){ ?>
		<tr><td><?php echo $test->lastname.",&nbsp".$test->firstname;?></td>
		<td><?php echo $test->subjectname; ?></td>
		<td><?php echo $test->description; ?></td>
		<td><?php echo $test->date; ?></td>
		<td><?php echo $test->time; ?></td>
		<td><?php if($test->adminstatus == "pending"){
				echo form_label('Pending', 'adminstatus'.$i);
			} elseif($test->adminstatus == "approved") {
				echo form_label('Approved', 'adminstatus'.$i);
			} else {
				echo form_label('Rejected', 'adminstatus'.$i);
			}
		;?></td>
		</tr>
		<?php $i++;?>
<?php	} ?>
</tbody>
</table>
<br><br><br>
<?php echo form_open('admin/update_schedule_status'); ?>
<h3>Pending classes for approval</h3>
<table id="sub" class="tablesorter"><thead class = "forms">
<tr><th>Subject Name</th><th>Name</th><th>E-mail</th><th>Date</th><th>Time</th><th>Admin Status</th></tr></thead><tbody>
<?php $i = 1;?>
<?php foreach($sched->result() as $test){ ?>
		<tr><td><?php echo $test->subjectname; ?></td>
		<td><?php echo $test->lastname.",&nbsp".$test->firstname;?></td>
		<td><?php echo $test->email;?></td>
		<td><?php echo $test->date; ?></td>
		<td><?php echo $test->time; ?></td>
		<td><?php echo form_radio('adminstatus'.$i, 'pending', $test->adminstatus == 'pending' ? TRUE : FALSE) . 'Pending'; echo "&nbsp;&nbsp;";
	echo form_radio('adminstatus'.$i, 'approved', $test->adminstatus == 'approved' ? TRUE : FALSE) . 'Approve';
	echo form_radio('adminstatus'.$i, 'rejected', $test->adminstatus == 'rejected' ? TRUE : FALSE) . 'Reject'; ?></td>
		</tr>
		<?php $i++;?>
<?php	} ?>
</tbody>
</table>
<?php echo form_submit('update', 'Take Action'); ?>
<?php echo form_close(); ?>
